﻿using UnityEngine;

namespace ProjectIndieFarm
{
    public class PowerUpGroupSoilGrid
    {
        public static void Setup(IPowerUpSystem system)
        {
            var soilGrid5 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv1")
                .SetTitle("土地升级Lv1")
                .SetDescription($"耕地格子增加到5x5 每日消耗增加${9}")
                .SetPrice(240)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 9;
                    Object.FindObjectOfType<GridController>().Resize(5, 5);
                    self.SendMessageWithEffect("土地大小变成 5x5");
                }));
            var soilGrid6 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv2")
                .SetTitle("土地升级Lv2")
                .SetDescription($"耕地格子增加到6x6 每日消耗增加${11}")
                .SetPrice(600)
                .ShowCondition(_ => soilGrid5.Unlocked)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 11;
                    Object.FindObjectOfType<GridController>().Resize(6, 6);
                    self.SendMessageWithEffect("土地大小变成 6x6");
                }));
            var soilGrid7 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv3")
                .SetTitle("土地升级Lv3")
                .SetDescription($"耕地格子增加到7x7 每日消耗增加${14}")
                .SetPrice(1100)
                .ShowCondition(_ => soilGrid6.Unlocked)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 14;
                    Object.FindObjectOfType<GridController>().Resize(7, 7);
                    self.SendMessageWithEffect("土地大小变成 7x7");
                }));
            var soilGrid8 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv4")
                .SetTitle("土地升级Lv4")
                .SetDescription($"耕地格子增加到8x8 每日消耗增加${18}")
                .SetPrice(1800)
                .ShowCondition(_ => soilGrid7.Unlocked)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 18;
                    Object.FindObjectOfType<GridController>().Resize(8, 8);
                    self.SendMessageWithEffect("土地大小变成 8x8");
                }));
            var soilGrid9 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv5")
                .SetTitle("土地升级Lv5")
                .SetDescription($"耕地格子增加到9x9 每日消耗增加${24}")
                .SetPrice(2700)
                .ShowCondition(_ => soilGrid8.Unlocked)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 24;
                    Object.FindObjectOfType<GridController>().Resize(9, 9);
                    self.SendMessageWithEffect("土地大小变成 9x9");
                }));
            var soilGrid10 = system.Add(new PowerUp()
                .SetKey("soil_grid_lv6")
                .SetTitle("土地升级Lv6")
                .SetDescription($"耕地格子增加到10x10 每日消耗增加${32}")
                .SetPrice(4000)
                .ShowCondition(_ => soilGrid9.Unlocked)
                .OnUnlock(self =>
                {
                    Global.DailyCostBase += 32;
                    Object.FindObjectOfType<GridController>().Resize(10, 10);
                    self.SendMessageWithEffect("土地大小变成 10x10");
                }));

        }
    }
}
